<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<div id="SaveOrUpdateDevWin"
	style="width: 600px; height: 410px; padding: 10px;overflow-y: auto;"
	class="easyui-dialog" title="查询录入操作"
	data-options="modal:true,closed:true,minimizable:false,collapsible:false,maximizable:false,iconCls:'icon-save',onClose:function(){$('#saveOrUpdateDevForm')[0].reset();} ">
	<form id="saveOrUpdateDevForm" method="post" enctype="multipart/form-data" >
		<div class="menu_form_body">
		
		  <table  border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr>
				  <th align="right" height="26">号牌号码：</th>
					<td align="right" width="100" height="40"
						class="tangchukuangliebiao1">
						<input id="hpSelect" style="width: 95%;" type="text" class="shurukuangkais" value="皖" /> <!-- placeholder="请输入号牌号码" value="" -->
						</td>
					<th align="right" height="26">号牌种类：</th>
					<td>
		                 <input type="text" id="hpzlSelection" class="easyui-combobox "
		                        data-options="prompt:'请选择号牌种类',url:'${ctx}/code/findCodeByCodetype.htm?xtlb=00&dmlb=1007',valueField:'dmz',textField:'dmsm1mc'">
		             </td>
					<td align="left" width="150" class="tangchukuangliebiao1">
						<a href="###" class="congzhim" id="shenqingcx"  style="margin: 0 5px 2px 0;">查询</a>
					</td>
				</tr>
			</table>
			<table name="hphm" border="0" cellpadding="0" cellspacing="0" width="100%" class="cheliangxinxi">
			   <tr>
	         	 <th align="right" height="26" width="100">号牌号码：</th>
	             <td>
	                 <span class="indexstylelist" id="hphmmc"></span>
	             </td>
	             <th align="right" height="26" width="100">号牌种类：</th>
	             <td>
	             		<span class="indexstylelist" id="hpzlmc"></span>
	             </td>
	         </tr>
	     	 <tr>
	         	 <th align="right" height="26">车辆品牌：</th>
	             <td>
	                 <span class="indexstylelist" id="clpp1"></span>
	             </td>
	             <th align="right" height="26">车身颜色：</th>
                 <td>
                     <span class="indexstylelist" id="csysmc"></span>
                 </td>
	         </tr>
	     	 <tr>
	     	     <th align="right" height="26">所有人：</th>
                 <td>
                     <span class="indexstylelist" id="syr"></span>
                 </td>
	         	 <th align="right" height="26">发动机号：</th>
	             <td>
	                   <span class="indexstylelist" id="fdjh"></span>     
	             </td>
	         </tr>
	         <tr>
	             <th align="right" height="26">车辆识别代号：</th>
	             <td>
	             	<span class="indexstylelist" id="clsbdh"></span>
	             </td>
	             <th align="right">外廓尺寸：</th>
	             <td>
	             	<span class="indexstylelist" id="wkccmc"></span>
	             </td>
	           </tr>
<!-- 	           <tr>
	               <th align="right">备注：</th>
	               <td colspan="3">
	                  <input id="bz" class="easyui-textbox" data-options="multiline:true"  style="width:300px;height:100px"/>
	                </td>
	           </tr> -->
			</table>
			<div class="shenqinganniudss" id="dd" style="display:none;">
				<a href="javascript:addTabFunc();" class="sousuocx"  style="padding: 1px 10px; margin: 0 4px 0 0;">进入编辑</a>
			</div>
		</div>
	</form>
</div>
		<input type="hidden" id="vehicleXh"/>
		<input type="hidden" id="vehicleHphm"/>
		<input type="hidden" id="vehicleHpzl" />
		<input type="hidden" id="vehicleClpp1" />
		<input type="hidden" id="vehicleClsbdh" />
		<input type="hidden" id="vehicleFdjh" />
		<input type="hidden" id="vehicleCsys"/>
		<input type="hidden" id="vehicleSyr"/>
		<input type="hidden" id="vehicleFzjg" />
		<input type="hidden" id="vehicleGlbm" />
		<input type="hidden" id="vehicleXzqh" />
		<input type="hidden" id="vehicleFdjh" />
<script type="text/javascript">

function addTabFunc(){
	//var xh=$("#vehicleXh").val();
	//var fdjh=$('#fdjh').text();
	var hpzl=$('#vehicleHpzl').val();
	var hphm=$('#vehicleHphm').val();
	parent.addTab("机动车档案录入", "${ctx}/yxxx/VehicleYxcjByhphmAndhpzl.htm?hphm="+hphm+"&hpzl="+hpzl);
}
function applyForAuth(){
	$('#SaveOrUpdateDevWin').window('open');
	clearInfo();
	$('#dd').hide();
	//$('#dd').show();
}
	//清空申请页面信息(机动车)
	function clearInfo(){
		 $('#vehicleHpzl').val('');
		 $('#vehicleHphm').val(''); 
		 $('#hphmmc').text('');
		 $('#hpzlmc').text('');
		 $('#clpp1').text('');
		 $('#csysmc').text('');
		 $('#syr').text('');
		 $('#fdjh').text('');
		 $('#clsbdh').text('');
		 $('#wkccmc').text('');
	}
   $(function(){   
	   $('#shenqingcx').unbind('click').bind('click',function(){
		   clearInfo();
		   var hphm=$.trim($('#hpSelect').val());//号牌号码
		   var hpzl=$.trim($('#hpzlSelection').combobox('getValue'));//号牌种类
		   var reg = /[\u4e00-\u9fa5]/g;//筛选是否有中文
		   hphm = hphm.replace(reg, "");		   
		   if(hphm!='' && hpzl !=''){
		       $.ajax({
		           type:'post',
		           url:'${ctx}/yxxx/queryVehcile.htm',
		           data:{
		               hphm:hphm,
		               hpzl:hpzl
		           },
		           dataType:'json',
		           success:function(data){
		               if(null!=data && data!=''){
		            	   if(data.zzz=='1'){
		            		   alert("此机动车档案已存在，请勿重复录入！");
		            	   }else{
		            	   $('#dd').show();
		            	   var fzjg=data.fzjg;
		            	   if(null!=fzjg && undefined!=fzjg){
		            		   fzjg=fzjg[0];
		            	   }
		            	    //影藏属性
		            	 /*  $('#vehicleXh').val(data.xh);
		            	     $('#vehicleHphm').val(fzjg+data.hphm);
		            	   $('#vehicleHpzl').val(data.hpzl);		            	   
		            	   $('#vehicleHpzlmc').val(data.hpzlmc);
		            	   $('#vehicleClpp1').val(data.clpp1);
		            	   $('#vehicleClsbdh').val(data.clsbdh);
		            	   $('#vehicleFdjh').val(data.fdjh);
		            	   $('#csys').val(data.csys);
	                       $('#csysmc').val(data.csysmc);
	                       $('#syr').val(data.syr);
	                       $('#vehicleFzjg').val(data.fzjg);                   
	                       $('#vehicleGlbm').val(data.glbm);
	                       $('#vehicleXzqh').val(data.xzqh); */
	                       
	                       //页面表单
		            	   $('#vehicleHphm').val(data.hphm);
		            	   $('#vehicleHpzl').val(data.hpzl);
		            	   $('#hphmmc').text(fzjg+data.hphm);
		            	   $('#hpzlmc').text(data.hpzlmc);
		            	   $('#clpp1').text(data.clpp1);
	                       $('#csysmc').text(data.csysmc);
	                       $('#syr').text(data.syr);
	                       $('#fdjh').text(data.fdjh);
	                       $('#clsbdh').text(data.clsbdh);
	                       var wkccmc='长:' + data.cwkc+' 宽:'+data.cwkk+' 高:'+data.cwkg;
	                       $('#wkccmc').text(wkccmc);
		            	 }
		               }else{
		            	   $('#dd').hide();
		            	   alert('该号牌号码不存在，请重新输入');
		               }
		           }
		       });
		   }else{
			   alert('号牌号码和号牌种类不能为空!');
		   }
		});
   });
</script>